package handler

import (
	"org.knight/api"
	"strings"
)

//biz code to capture the main content of the ie

type ContentCaptureHandler struct {

}

func (cch *ContentCaptureHandler) Handle(c *api.Context)  {
	if c.IE == nil || c.E == nil {
		return
	}

	var builder strings.Builder
	for _, run := range c.E.P.Runs() {
		builder.WriteString(run.Text())
	}

	//log.Printf("c.IE=%s  \n", c.IE)
	if c.IE.Brief == "" {
		c.IE.Brief = builder.String()
	}
	c.IE.Desc = c.IE.Desc + "\n" + builder.String()


	/// 尝试解析对应的表

	 //p := c.E.P.X()
	 //log.Printf("try capture table %s" ,p.EG_PContent[0])
}




